package com.bbms.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.bbms.dao.ReaderCategoryDao;
import com.bbms.entity.Page;
import com.bbms.entity.ReaderCtaegory;
import com.bbms.service.ReaderCategoryService;

/**
 * 读者类型业务实现类
 * @author Administrator
 *
 */
@Service("ReaderCategoryServiceImpl")
public class ReaderCategoryServiceImpl implements ReaderCategoryService{

	@Resource(name="ReaderCategoryDaoImpl")
	private ReaderCategoryDao rcd;
	
	
	/**
	 * 获取分页数据业务
	 */
	@Override
	public Page getPage(int currentPage, int pageSize) {
		Page page=rcd.getPage(currentPage, pageSize);
		return page;
	}
	
	/**
	 * 获取全部类型业务
	 */
	public Object getAllData(){
		
		Object object=JSON.toJSON(rcd.query());
		return object;
	}

	/**
	 * 添加读者类型业务
	 */
	@Override
	public void add(ReaderCtaegory t) {
		rcd.save(t);		
	}

	/**
	 * 更新读者类型业务
	 */
	@Override
	public void update(ReaderCtaegory t) {
		rcd.update(t);
		
	}

	/**
	 * 删除读者类型业务
	 */
	@Override
	public void delete(ReaderCtaegory t) {
		rcd.delete(t);
	}

}
